/**财务管理-收据API**/
import obj from '@/utils/request'
let {request,baseURL} = obj

//分页查询
export function getReceiptInfo(params) {
  return request({
    url: '/receiptInfo',
    method: 'get',
    params
  })
}
//修改
export function modReceiptInfo(data) {
  return request({
    url: '/receiptInfo',
    method: 'put',
    data
  })
}
//添加
export function addReceiptInfo(data) {
  return request({
    url: '/receiptInfo',
    method: 'post',
    data
  })
}
//删除
export function delReceiptInfo(ids) {
  return request({
    url: '/receiptInfo',
    method: 'delete',
    data:ids
  })
}
//根据编号创建收据
export function createReceiptInfo(data) {
  return request({
    url: '/receiptInfo/build/',
    method: 'post',
    data
  })
}
//根据收据号查询数据
export function getReceiptInfoByCode(receiptCode) {
  return request({
    url: '/receiptInfo/'+receiptCode,
    method: 'get',
  })
}
//根据收据号修改商品应收金额
export function modReceiptExchange(receiptCode,params) {
  return request({
    url: '/receiptInfo/exchange/'+receiptCode,
    method: 'get',
    params
  })
}

//售后
export function addReceiptInfoRefund(data) {
  return request({
    url: '/receiptInfo/refund',
    method: 'post',
    data
  })
}

//根据收据号支付
export function addReceiptInfoPay(receiptCode,data) {
  return request({
    url: '/receiptInfo/pay/'+receiptCode,
    method: 'post',
    data
  })
}
//揽收包裹
export function addReceiptOrder(data) {
  return request({
    url: '/receiptInfo/receiptOrder',
    method: 'post',
    data
  })
}
//根据单号查询包裹
export function getOrder(orderCode) {
  return request({
    url: '/receiptInfo/order/'+orderCode,
    method: 'get',
  })
}

//删除包裹
export function delReceiptOrder(ids) {
  return request({
    url: '/receiptInfo/receiptOrder',
    method: 'delete',
    data:ids
  })
}
//撤销支付
export function delReciptInfoUnpay(paymentInfoId) {
  return request({
    url: '/receiptInfo/unpay/'+paymentInfoId,
    method: 'delete',
  })
}
//打印
export function printInvoice(data) {
  return request({
    url: '/receiptInfo/print',
    method: 'post',
    data
  })
}

